//
//  TraiangleView.swift
//  funcode
//
//  Created by Wan Jiading on 2016/12/1.
//  Copyright © 2016年 WanJiading. All rights reserved.
//

import UIKit

class TraiangleView: UIView {

	
    override func draw(_ rect: CGRect) {

		let ctx = UIGraphicsGetCurrentContext()
		
		let path = UIBezierPath.init()
		path.move(to: CGPoint(x: 10, y: 20))
		path.addLine(to: CGPoint(x: 200, y: 200))
		path.addLine(to: CGPoint(x: 280, y: 100))
		path.close()
		ctx?.addPath(path.cgPath)
		UIColor.red.setFill()
		
		ctx?.drawPath(using: CGPathDrawingMode.fillStroke)
		
    }

}
